-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(events): clean up Events APIs #2840
Conversation
Biggest change is modeling the schedule types. BREAKING CHANGE: * **events**: `EventPattern.detail` is now a map. * **events**: `scheduleExpression: string` is now `schedule: Schedule`.
@@ -26,7 +27,7 @@ class EventStack extends cdk.Stack { | |||
memoryLimitMiB: 512, | |||
cpu: 1, | |||
environment: { name: 'TRIGGER', value: 'CloudWatch Events' }, | |||
scheduleExpression: 'rate(1 minute)' | |||
schedule: events.Schedule.fromRate(1, events.TimeUnit.Minute), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don’t like the “from” prefix. It doesn’t read right. It’s not “schedule from rate”. I think just “Schedule.rate” feels better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we maybe use the Duration
class here somehow? This is a length of time...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not merged yet, is it?
*/ | ||
readonly weekDay?: string; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need this subclass?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So that it becomes obvious for future contributors where to add extensions.
Biggest change is modeling the schedule types.
BREAKING CHANGE:
EventPattern.detail
is now a map.scheduleExpression: string
is nowschedule: Schedule
.Pull Request Checklist
design
folderBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license.